package com.njxxted.activiti.modules.process.extend.dao;

import com.njxxted.activiti.modules.base.dao.BaseDao;
import com.njxxted.activiti.modules.process.extend.entity.ActProcessConfigEntity;
import com.njxxted.activiti.modules.process.extend.entity.ExtendActInstanceEntity;
import com.njxxted.activiti.modules.process.extend.entity.req.ExtendActInstanceReqEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 描述：工作流扩展表-流程实例表 Dao
 * <p>
 * 作者：HuTongFu
 * 邮箱：hu_tongfu@163.com
 * 时间：2019-08-10 17:14:48
 */
@Mapper
public interface ExtendActInstanceDao extends BaseDao<ExtendActInstanceEntity> {

    /**
     * 根据流程实例id和业务主键id跟新流程状态
     *
     * @param extendActInstanceEntity
     * @return
     */
    int updateByInstanceId(ExtendActInstanceEntity extendActInstanceEntity);

    /**
     * 根据条件查询
     *
     * @param appendSql 自定义 sql 字符串
     * @return
     */
    List<ExtendActInstanceEntity> queryListByCondition(@Param("appendSql") String appendSql);

    /**
     * 查询抄送人的流程
     */
    List<ExtendActInstanceEntity> queryCopyList(ExtendActInstanceReqEntity param);

    /**
     * 查询已办列表
     *
     * @param param
     * @return
     */
    List<ExtendActInstanceEntity> getExtInstanceList(ExtendActInstanceReqEntity param);

    /**
     * 查询我发起的流程列表
     *
     * @param param
     * @return
     */
    List<ExtendActInstanceEntity> getMyStartedList(ExtendActInstanceReqEntity param);

    /**
     * 查询我办理的已办列表
     *
     * @param param
     * @return
     */
    List<ExtendActInstanceEntity> getMyHasBeenDoneList(ExtendActInstanceReqEntity param);

    List<ActProcessConfigEntity> getProcessAssignConfig();

    /**
     * 查询已办理的流程数量
     *
     * @param param
     * @return
     */
    int getMyHasBeenDoneCount(ExtendActInstanceReqEntity param);

    /**
     * 查询我的草稿
     *
     * @param param
     * @return
     */
    List<ExtendActInstanceEntity> getMyDraftList(ExtendActInstanceReqEntity param);
}
